﻿package net.wangit.jdbc;

import java.sql.PreparedStatement;
import java.sql.SQLException;

public class NonBatchingBatcher extends BatcherImpl {

	public NonBatchingBatcher(DBImplementor db) {
		super(db);
	}

	public void addToBatch(int expectedRowCount) throws SQLException,
			JDBCException {
		int rowCount = getBatchStatement().executeUpdate();
		if (expectedRowCount > 0 && expectedRowCount != rowCount)
			throw new JDBCException(
					"SQL insert, update or delete failed (row not found)");
		else
			return;
	}

	protected void doExecuteBatch(PreparedStatement preparedstatement)
			throws SQLException, JDBCException {
	}
}
